
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
<meta name="format-detection" content="telephone=no" >
<meta name="apple-touch-fullscreen" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>申请{$bank.name}信用卡</title>
<link rel="stylesheet" href="/static/home/reg/css/wangdai.css">
<link rel="stylesheet" href="/static/home/reg/css/layer.css">
<script src="/static/home/reg/js/jquery-1.12.4.min.js"></script>
<script src="/static/home/layer_mobile/layer.js"></script>
<style>

</style>
</head>
<body>
	
<div class="tui-lj-div" style="">
	<?php echo htmlspecialchars_decode($bank['content']);?>
	<div class="marck" style="display: none;"></div>
</div>
	<div class="tui-lj" style="display: none;">
		<div class="tui-head-box"><p>身份验证</p></div>
		<form id="w0" action="" method="post">
			<input type="text" name="ac_name" placeholder="请输入姓名" class="yhka">
			<div class="daili-input-yzm">
				<input type="tel" name="ac_mobile" placeholder="请输入手机号">
			</div>
			<input type="hidden" name="id" value="{$bank.id}">
			<input type="hidden" name="vid" value="{$vid}">
			<input type="hidden" name="code" value="{$code}">
			<div class="radio-tgul-box">
        		<input id="item1" type="radio" name="item" value="选项一" checked>
        		<label for="item1"></label>
        		<span>阅读知晓并同意<a href="{:url('login/fuwuxieyi')}">《平台服务协议》</a></span>
			</div>
			<div class="msms-ag">
				<p>1.请务必填写本人真实个人信息</p>
				<p>2.银行审核通知将以短信形式直接发送到手机</p>
			</div>
		</form>
		
	</div>
	<div class="btnsq-box" >
		<input type="button" value="马上申请" class="btnljsq bluebgd"/>
	</div>
<script>
	

function _return(){
	window.history.back()
}

$(function(){
//	var h=$(window).height();
//	$(".marck").height(h);
var h=$(window).height(); 

	var btnto = false;
	var radios = true;
	$("#item1").click(function(event){
	if(radios){
		$(this).attr("checked",false);
		radios = false;
	}else{
		$(this).attr("checked","checked");
		radios = true;
	}
//		?:;
//      $(this).is(":checked")?$(this).attr("checked":"checked"):$(this).removeAttr("checked");
    });
var marckck=function(){
	$("body,html").css({"overflow":"auto","height":"auto"}); 
	$(".tui-lj").slideUp("slow",function(){});
	$(".marck").fadeOut();
	$(".btnljsq").val("马上申请");
	btnto = false;
};
$(".btnljsq").on("click",function(){
	$(".btnljsq").val("确 定");
	$(".marck").fadeIn();
	$(".tui-lj").slideDown("slow",function(){
		btnto = true;
	});
	$(".marck").bind("click",marckck);
	$("body,html").css({"overflow":"hidden","height":h+"px"});
	
})

$(".marck").click(function(){
	$(".marck").bind("click",marckck);
})
$(".tui-lj").click(function(){
	$(".marck").unbind("click",marckck);
})
//	var h=$(window).height();
//	$(".tui-lj-div").height(h);

	$(".tui-lj-div").css({"overflow":"hidden"});

	
	
	$('.bluebgd').click(function(){
		if(btnto){
		var ac_mobile = $('input[name=ac_mobile]');
		var ac_name = $('input[name=ac_name]');
		var ac_id_card = $('input[name=ac_id_card]');
				if($.trim(ac_mobile.val()).length==0){
			//提示
			layer.open({
				content: '请填写手机号码',
				fixed:true,
				top:-390,
				skin: 'msg',
				time: 2 //2秒后自动关闭
			});
			return false;
		}
		var regist = /^1[345789]\d{9}$/;
		if(!regist.test(ac_mobile.val())){
			//提示
			layer.open({
				content: '请填写正确的手机号码',
				fixed:true,
				top:-390,
				skin: 'msg',
				time: 2 //2秒后自动关闭
			});
			return false;
		}
						if($.trim(ac_name.val()).length==0){
			//提示
			layer.open({
				content: '请填写姓名',
				fixed:true,
				top:-390,
				skin: 'msg',
				time: 2 //2秒后自动关闭
			});
			return false;
		}
		
		if(!radios){
			layer.open({
				content: '请勾选同意平台服务协议',
				fixed:true,
				top:-390,
				skin: 'msg',
				time: 2 //2秒后自动关闭
			});
			return false;
		}
				$.post("{:url('bank/saveinfo')}",$('form').find('input').serialize(),function(data){
			if(data.code ==1){
				location.href="{$bank.href}";
			}else if(data.code ==2){
                  location.href="{$bank.href}";
			}else{
				layer.msg(data.msg, {time: 1800, icon: 2}, function () {
                        location.href="/";
                    })
			}
		},'json');
		return false;
		}
	});
});
</script>
</body>
</html>